<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
else
{
$Lab_Id=$_SESSION['Lab_Id'];
$School_Id=$_SESSION['School_Id'];
   
   $Lab_Id1=$_POST['Lab_Id'];
   $School_Id1=$_POST['School_Id'];
  $Source_Of_Power=$_POST['Source_Of_Power'];
    $Tp_Number=$_POST['Tp_Number'];
     $Account_Number=$_POST['Account_Number'];
    $Date_of_commencement=$_POST['Date_of_commencement'];
	
	$Availability_Of_LAN=$_POST['Availability_Of_LAN'];
  $LAN_Supplier=$_POST['LAN_Supplier'];
   $Supplied_Date=$_POST['Supplied_Date'];
    $Speed_Of_WAN=$_POST['Speed_Of_WAN'];
     $WAN_Connection_Type=$_POST['WAN_Connection_Type'];
	 $Wired_Date=$_POST['Wired_Date'];
	$Internet_Facilities=$_POST['Internet_Facilities'];
  
 
  if($Lab_Id1==""||$School_Id1==""||$Source_Of_Power==""||$Tp_Number==""||$Account_Number==""||$Date_of_commencement==""||$Availability_Of_LAN==""||$LAN_Supplier==""||$Supplied_Date==""||$Speed_Of_WAN==""||$WAN_Connection_Type==""||$Wired_Date==""||$Internet_Facilities=="")
  {
	  $_SESSION['errorin']="Please check your inputs!";
  }
 if($Lab_Id1!=""&&$School_Id1!=""&&$Source_Of_Power!=""&&$Tp_Number!=""&&$Account_Number!=""&&$Date_of_commencement!=""&&$Availability_Of_LAN!=""&&$LAN_Supplier!=""&&$Supplied_Date!=""&&$Speed_Of_WAN!=""&&$WAN_Connection_Type!=""&&$Wired_Date!=""&&$Internet_Facilities!="")
  {

  $sql=mysql_query("UPDATE lab SET School_Id='$School_Id1',Lab_Id='$Lab_Id1',Source_Of_Power='$Source_Of_Power',Tp_Number='$Tp_Number',Account_Number='$Account_Number',Date_of_commencement='$Date_of_commencement' WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");
$sqln=mysql_query("UPDATE network SET School_Id='$School_Id1',Lab_Id='$Lab_Id1',Availability_Of_LAN='$Availability_Of_LAN',Speed_Of_WAN='$Speed_Of_WAN',LAN_Supplier='$LAN_Supplier',Supplied_Date='$Supplied_Date',WAN_Connection_Type='$WAN_Connection_Type',Wired_Date='$Wired_Date',Internet_Facilities='$Internet_Facilities' WHERE School_Id='$School_Id' AND Lab_Id='$Lab_Id'");

unset($_SESSION['Lab_Id']);
unset($_SESSION['School_Id']);
if($sql)
  {
 
$_SESSION['error']="This record is successfully updated!";

  }

  if(!$sql)
  {
 $_SESSION['error']="Sorry unable to update the lab's basic details!";

 
  }
  if(!$sqln)
  {
 $_SESSION['errornet']="Sorry unable to update the network details!";


  }
  }
}


?>
</body>
</html>
